The Image Control
The Image object is used to display a picture on the application. This object supports a large variety of image formats in a Thin Client environment. They are BMP, DIB, GIF, JPG, WMF, EMF and ICO. This object can only be seen in the graphical version of the client. When using the Windows CE / Mobile environment, this control only supports the BMP format.
Image property - This property is the container for your resource image and its size is controlled by the Size property and its placement is indicated in the Location property.
LockAspect and Stretch properties - These two properties work together to enable you to control how an image is resized relative to the Image property which contains the image resource.
- If LockAspect and Stretch are set to True, then the image will stay proportional and not become distorted when the Image container is resized enlarged or shrunk or when change the dimensions of the Size property. If you enter an odd height and width combination, the image will automatically adjust its size to retain it aspect ratios.
- If LockAspect is set to True, and Stretch is set to False, then the image size will not be stretched or resize when the Image control is resized. Instead, the image will retain its original resource size. If you want space between the image and container borders, use this setting. For example, if the image was 219 x 219 pixels, but the container was sized to a width of 400 and a height of 100, part of the image would be cut off and there would be space between the edges of the image and the image container.
- If LockAspect is set to False, and Stretch is set to True, the image will stretch to the edge of the Image container. So if your image was 219 x 219 pixels, and you entered width=400 and height=100, the image will stretch out but become distorted.
- If LockAspect and Stretch are both set to False, the image will still retain its aspect ratio and not resize.
Image > Visible properties. There are two Visible properties. The first one can be used to specify if the Image would display INSIDE a control. The other Visible property at the bottom of the list specifies if the image will be visible if the image is not inside a control.
Other Image Control Property Descriptions
For property descriptions, see Graphical Control Properties.
Image Control and Events
The GotFocus, OnEnter and LostFocus events are executed when the image is next in the tab order or when the user clicks on the image. In this case, the Click event will also execute.
At runtime check the Defaults property to get the name of the image resource currently loaded into the prompt. If it is blank the image may have come from the file system using the RFPrompt( ).ImagePath property.
Note: this prompt will never hold the focus. When focus comes to this prompt it immediately processes the events and focus then moves to the next prompt. If it is simply clicked on, the focus will stay where it was before the click.